import Vue from 'vue'
import Router from 'vue-router'
import VueResource from 'vue-resource'
import Home from '../components/tabbar/home'
import Membar from '../components/tabbar/membar'
import Shopcar from '../components/tabbar/shopcar'
import Search from '../components/tabbar/search'
import NewsList from '../components/news/newsList'
import NewsInfo from '../components/news/newsInfo'
import PhotoList from '../components/photos/photoList'
import PhotoInfo from '../components/photos/photoInfo'
import GoodsList from '../components/goods/goodsList'
import GoodsInfo from '../components/goods/goodsInfo'
import GoodsDesc from '../components/goods/goodsDesc'
import GoodsComment from '../components/goods/goodsComment'
import UserInfo from '../components/user/userInfo'
import ChangeInfo from '../components/user/ChangeInfo'

Vue.use(Router)
Vue.use(VueResource)

export default new Router({
    routes: [{
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: Home
        }, {
            path: '/membar',
            name: 'membar',
            component: Membar
        }, {
            path: '/shopcar',
            component: Shopcar
        }, {
            path: '/search',
            component: Search
        }, {
            path: '/home/newsList',
            component: NewsList
        }, {
            path: '/home/newsInfo/:id',
            component: NewsInfo
        }, {
            path: '/home/photoList',
            component: PhotoList
        }, {
            path: '/home/photoInfo/:id',
            component: PhotoInfo
        }, {
            path: '/home/goodsList',
            component: GoodsList
        }, {
            path: '/home/goodsInfo/:id',
            component: GoodsInfo
        }, {
            path: '/home/goodsDesc/:id',
            name: 'goodsdesc',
            component: GoodsDesc
        }, {
            path: '/home/goodsComment/:id',
            name: 'goodscomment',
            component: GoodsComment
        }, {
            path: '/membar/userInfo',
            component: UserInfo
        }, {
            path: '/membar/changeInfo',
            component: ChangeInfo
        }
    ]
})